<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>

<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title><tiles:insertAttribute name="title" ignore="true" /></title>
<link rel="shortcut icon" href="${ctx}/assets/img/favicon.ico" >

<c:if test="${env == 'production' }">
<link rel='stylesheet' href="${ctx}/assets/css/bootstrap.min.css?v=${version}" type="text/css" media='screen' />
<link rel='stylesheet' href="${ctx}/assets/css/style-responsive.css?v=${version}" type="text/css" media='screen' />
<link rel='stylesheet' href="${ctx}/assets/sea-modules/jscal2/jscal2/1.9/css/jscal2.css?v=${version}" type="text/css"/>
<link rel='stylesheet' href="${ctx}/assets/sea-modules/jscal2/jscal2/1.9/css/border-radius.css?v=${version}" type="text/css"/>
<link rel='stylesheet' href="${ctx}/assets/css/admin.min.css?v=${version}" type="text/css" media='screen' />
<link rel='stylesheet' href="${ctx}/assets/sea-modules/jquery/jquery-jbox/2.3/Skins/Bootstrap/jbox.css?v=${version}" type="text/css"/>
</c:if>

<c:if test="${env != 'production' }">
<link rel='stylesheet' href="${ctx}/assets/css/bootstrap.css?v=${version}" type="text/css" media='screen' />
<link rel='stylesheet' href="${ctx}/assets/css/style-responsive.css?v=${version}" type="text/css" media='screen' />
<link rel='stylesheet' href="${ctx}/assets/sea-modules/jscal2/jscal2/1.9/css/jscal2.css?v=${version}" type="text/css" />
<link rel='stylesheet' href="${ctx}/assets/sea-modules/jscal2/jscal2/1.9/css/border-radius.css?v=${version}" type="text/css"/>
<link rel='stylesheet' href="${ctx}/assets/css/admin.css?v=${version}" type="text/css" media='screen' />
<link rel='stylesheet' href="${ctx}/assets/sea-modules/jquery/jquery-jbox/2.3/Skins/Bootstrap/jbox.css?v=${version}" type="text/css"/>
</c:if>

<script src="${ctx}/assets/sea-modules/seajs/seajs/2.1.1/sea.js"></script>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
  <script src="${ctx}/assets/js/html5shiv.js"></script>
  <script src="${ctx}/assets/js/respond.min.js"></script>
<![endif]-->
    
<script>
  seajs.config({
    base: "${ctx}/assets/sea-modules/",
    map: [[ /^(.*\.(?:js))(.*)$/i, '$1?v=${version}' ]],
    paths: {
    	"echarts" : "echarts/1.2.1",
        "zrender" : "zrender/1.0.4"
    },
    alias: {
      "jquery" : "jquery/jquery/1.10.1/jquery",
      "jquery-migrate" : "jquery/jquery/1.10.1/jquery-migrate",
      "jbox" : "jquery/jquery-jbox/2.3/jquery.jBox-2.3.min",
      "echarts" : "echarts/echarts",
      "zrender" : "zrender/zrender"
    }
  });
  
  $CONFIG={
			base_url: '${ctx}',
			env: '${env}',
			version: '${version}',
			admin_url:'${admin_url}'
		};
  g_user={
			id: '<shiro:principal property="id"/>',
			name: '<shiro:principal property="name"/>',
			role: '<shiro:principal property="roles"/>',
			login: true
		};
  
</script>
</head>
<body>
	 <shiro:authenticated>  
	<!-- Container begin -->
	<tiles:insertAttribute name="header" />
	<div class="row-fuild" style="padding-top: 20px;">
		
		<div class="sidebar-scroll" style="overflow:hidden; outline: none;" id="sidebar-scroll">
			<tiles:insertAttribute name="sider" />
		</div>
		<div id="main-content">
			<tiles:insertAttribute name="r-content" />
		</div>
		
	</div>
	<div id="footer">
         
	</div>
	
	<c:if test="${env == 'production' }">
		<script type="text/javascript">
			seajs.use("${ctx}/assets/sea-modules/bootstrap/bootstrap/2.3.0/bootstrap.min");
			seajs.use("${ctx}/assets/js-dist/menu");
			seajs.use("${ctx}/assets/js-dist/util/common");
		</script>
	</c:if>
	<c:if test="${env != 'production' }">
		<script type="text/javascript">
			seajs.use("${ctx}/assets/sea-modules/bootstrap/bootstrap/2.3.0/bootstrap");
			seajs.use("${ctx}/assets/js/menu");
			seajs.use("${ctx}/assets/js/util/common");
		</script>
	</c:if>
	</shiro:authenticated>  
	<shiro:notAuthenticated>  
		<!-- <p class="lead" style="text-align:center;"><font color="white">您还没有登录呢，请先登录</font><a href="${ctx}/login" >点击登录</a></p>  -->
		<script type="text/javascript">
			window.location.href="${ctx}/login"	;
		</script>
	
	</shiro:notAuthenticated>  
</body>
</html>
